package com.bsoft.gol.hcs.enumcase;

/**
 * @author tongtp
 * @version v0.1
 * @package enumcase
 * @className ExecutionModeEnum
 * @description 执行方式枚举类
 * @create 2021-08-06 16:29
 **/
public enum ExecutionModeEnum {
	//执行方式：1 订阅 2 手动检索
	SUBSCRIBE((byte) 1, "订阅"),
	SEARCH((byte) 2, "手动检索");

	private final Byte modeCode;

	private final String modeName;

	ExecutionModeEnum(Byte modeCode, String modeName) {
		this.modeCode = modeCode;
		this.modeName = modeName;
	}

	public static ExecutionModeEnum getEnumByKey(Byte modeCode) {
		for (ExecutionModeEnum temp : ExecutionModeEnum.values()) {
			if (temp.getModeCode().equals(modeCode)) {
				return temp;
			}
		}
		return null;
	}

	public String getModeName() {
		return modeName;
	}

	public Byte getModeCode() {
		return modeCode;
	}
}
